﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeBehind="Add.aspx.cs" Inherits="lcs.Web.materialinfo.Add" Title="增加页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
          $(function () {
             $("#<%# txtprojectname.ClientID%>").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName , value: item.projectName + "__" + item.proid };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
        
         </script>
    <style type="text/css">
        .auto-style1 {
            text-align: right;
        }
        .auto-style2 {
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">    
    <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
        <tr>
            <td class="tdbg">
                
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		项目名称
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtprojectname" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		需用单位
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtusework" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		项目类型
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtprojecttype" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		供应商名称
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtsupplier" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		物料描述
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtmaterial" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
    <tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		规格型号
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtmodel" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
    <tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		物料编码
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtbm" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		数量
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtnums" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		单位
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtunit" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		供应商联系人
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtsuppliername" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		联系电话
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:TextBox id="txtsupplierphone" runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right" class="auto-style1">
		物料类型
	：</td>
	<td height="25" width="*" align="left" class="auto-style2">
		<asp:DropDownList ID="ddltype" runat="server">
            <asp:ListItem Value="0">新加</asp:ListItem>
            <asp:ListItem Value="1">节余</asp:ListItem>
            <asp:ListItem Value="2">废旧</asp:ListItem>
        </asp:DropDownList>
	</td></tr>
</table>

            </td>
        </tr>
        <tr>
            <td class="tdbg" align="center" valign="bottom">
                <asp:Button ID="btnSave" runat="server" Text="保存"
                    OnClick="btnSave_Click" class="inputbutton" ></asp:Button>
                <asp:Button ID="btnCancle" runat="server" Text="取消"
                    OnClick="btnCancle_Click" class="inputbutton" ></asp:Button>
            </td>
        </tr>
    </table>
    <br />
</asp:Content>
<%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceCheckright" runat="server">
</asp:Content>--%>
